<!--
 * @Descripttion: 
 * @Author: lukasavage
 * @Date: 2022-01-19 21:18:38
 * @LastEditors: lukasavage
 * @LastEditTime: 2022-02-13 13:48:18
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>hello,vue and rollup</title>
</head>

<body>
    hello
    <div id="app">
        我是文本
        <div id="my">
            hello,
            <span style="color: red;">{{ str }} {{str}} ewer</span>
        </div>
    </div>
    <script src="dist/umd/vue.js"></script>
    <script>
        // 混合、混入
        Vue.mixin({
            created() {
                // console.log('mixin中的created');
            }
        })
        Vue.mixin({
            created() {
                // console.log('mixin2中的created');
            }
        })

        const vm = new Vue({
            // el: '#app',
            data() {
                return {
                    hehe: 123,
                    str: 'world'
                }
            },
            created() {
                // console.log('vm中的created');
            },
            watch: {
                str(newVal, oldVal) {
                    console.log(oldVal);
                }
            }
        })
        vm.$mount('#app')
        // vm._data.a = 1
        // setTimeout(() => {
        //     vm.hehe = 1
        //     vm.str = 'fuck you!!!'
        //     vm.$nextTick(() => { })
        // }, 1000);


        // setTimeout(() => {
        //     vm.str = 'fuck you!!!'
        //     // vm._update(vm._render());
        // }, 1000);
        // vm.$nextTick(()=>{
        //     console.log(1111);
        // })
    </script>
</body>

</html>